package com.project.andeper.paperproject;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import java.sql.Time;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class QueryHourActivity extends AppCompatActivity {
    EditText timeEdittest;
    EditText numberEdittext;
    Button btnTime;
    Button btnNumber;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_query_hour);
        btnTime = (Button)findViewById(R.id.btn_time);
        btnNumber = (Button)findViewById(R.id.btn_number);
        timeEdittest = (EditText)findViewById(R.id.hour_time);
        numberEdittext = (EditText)findViewById(R.id.dev_number);
    }

    public void onCClick(View view) {
        switch (view.getId()) {
            case R.id.btn_time:
                Intent intent = new Intent(this,TimeDataActivity.class);
                String getTime = timeEdittest.getText().toString();
                intent.putExtra("queryTime",getTime);
                startActivity(intent);
                break;
            case R.id.btn_number:
                Intent intent2 = new Intent(this,ShowElectricForHourActivity.class);
                String getNumber = numberEdittext.getText().toString();
                intent2.putExtra("number",getNumber);
                startActivity(intent2);
                break;
        }
    }
}
